/**
 * @(#) CongMoneyFacade.as
 *
 * @date		2009. 02. 17.
 * @version		1.0
 * @author		Shin, Yunwoo
 * @description	module facade (경조사 신청)
 * 				mvc간 주고 받는 메세지를 정의하고,  command를 등록한다.
 */
package com.skt.common_hr.congrest
{
	import com.skt.common_hr.common.puremvc.CommonFacade;
	import com.skt.common_hr.congrest.controller.StartupCommand;

	import flash.display.DisplayObject;

	import org.puremvc.as3.multicore.interfaces.IFacade;

	public class CelebrationFacade extends CommonFacade
	{
		public static const STARTUP:String 									= 'startup';
		public static const CLOSE_MODULE:String								= 'closeModule';

		public static const LOAD_CELEBRATION_LIST_COMPLETE:String			= "LoadCelebrationListComplete";
		public static const LOAD_CELEBRATION_LIST_FAILED:String				= "LoadCelebrationListFailed";
		public static const LOAD_CELEBRATION_DETAIL_COMPLETE:String			= "loadCelebrationDetailComplete";
		public static const LOAD_CELEBRATION_DETAIL_FAILED:String			= "loadCelebrationDetailFailed";
		public static const SAVE_CELEBRATION_COMPLETE:String				= "saveCelebrationComplete";
		public static const SAVE_CELEBRATION_FAILED:String					= "saveCelebrationFailed";

		public static const LOAD_CELEBRATION_CODE_COMPLETE:String			= "loadCelebCodeComplete";
		public static const LOAD_CELEBRATION_CODE_FAILED:String				= "loadCelebCodeFailed";

		//public static const LOAD_CONGMONEY_SELECTPOP_COMPLETE:String		= "LoadCongmoneySelectpopComplete";
		//public static const LOAD_CONGMONEY_SELECTPOP_FAILED:String			= "LoadCongmoneySelectpopFailed";
		public static const LOAD_CONGMONEY_WRITE_COMPLETE:String			= "LoadCongmoneyWriteComplete";
		public static const LOAD_CONGMONEY_WRITE_FAILED:String				= "LoadCongmoneyWriteFailed";
		public static const LOAD_CONGMONEY_ACCOUNT_COMPLETE:String			= "LoadCongmoneyAccountComplete";
		public static const LOAD_CONGMONEY_ACCOUNT_FAILED:String			= "LoadCongmoneyAccountFailed";
		public static const LOAD_CONGMONEY_BANKA_COMPLETE:String			= "LoadCongmoneyBankaComplete";
		public static const LOAD_CONGMONEY_BANKA_FAILED:String				= "LoadCongmoneyBankaFailed";
		public static const LOAD_CONGMONEY_SAVE_COMPLETE:String				= "LoadCongmoneySaveComplete";
		public static const LOAD_CONGMONEY_SAVE_FAILED:String				= "LoadCongmoneySaveFailed";
		public static const LOAD_CONGMONEY_SELECTED_COMPLETE:String			= "LoadCongmoneySelectedComplete";
		public static const LOAD_CONGMONEY_DELETE_COMPLETE:String			= "LoadCongmoneyDeleteComplete";
		public static const LOAD_CONGMONEY_DELETE_FAILED:String				= "LoadCongmoneyDeleteFailed";
		public static const LOAD_CONGMONEY_SELECT_LOAD_COMPLETE:String		= "LoadCongmoneySelectLoadComplete";
		public static const LOAD_CONGMONEY_SELECT_LOAD_FAILED:String		= "LoadCongmoneySelectLoadFailed";
		public static const LOAD_CONGMONEY_WRITE_INITIAL:String				= "LoadCongmoneyWriteInitial";
		public static const LOAD_CONGMONEY_CORSNVIEW_COMPLETE:String		= "LoadCongmoneyCorsnviewComplete";
		public static const LOAD_CONGMONEY_CORSNVIEW_FAILED:String			= "LoadCongmoneyCorsnviewFailed";

		public static const LOAD_CONGMONEY_PRINT_COMPLETE:String			= "LoadCongmoneyPrintComplete";
		public static const LOAD_CONGMONEY_PRINT_FAILED:String				= "LoadCongmoneyPrintFailed";

		public static const LOAD_BANKCODE_COMPLETE:String					= "LoadBankcodeComplete";
		public static const LOAD_BANKCODE_FAILED:String						= "LoadBankcodeFailed";
		public static const LOAD_ACCOUNTLIST_COMPLETE:String				= "LoadAccountlistComplete";
		public static const LOAD_ACCOUNTLIST_FAILED:String					= "LoadAccountlistFailed";

		public static const LOAD_ORGLIST_COMPLETE:String					= "LoadOrglistComplete";
		public static const LOAD_ORGLIST_FAILED:String						= "LoadOrglistFailed";

		public static const LOAD_MEMBERSEARCH_COMPLETE:String				= "loadMembersearchComplete";
		public static const LOAD_MEMBERSEARCH_FAILED:String					= "loadMembersearchFailed";
		public static const LOAD_NAMESEARCH_COMPLETE:String					= "LoadNamesearchComplete";
		public static const LOAD_NAMESEARCH_FAILED:String					= "LoadNamesearchFailed";


		public static const LOAD_FAMILY_COMPLETE:String						= "LoadFamilyComplete";
		public static const LOAD_FAMILY_FAILED:String						= "LoadFamilyFailed";
		public static const LOAD_FAMILY_INFO:String							= "LoadFamilyInfo";
		public static const LOAD_DEFAULT_FAMILY_FAILED:String				= "LoadDefaultFamilyFailed";

		public static const LOAD_ACCOUNT_SAVE_COMPLETE:String				= "LoadAccountSaveComplete";
		public static const LOAD_ACCOUNT_SAVE_FAILED:String					= "LoadAccountSaveFailed";
		public static const LOAD_CONGMONEY_ACCOUNT_INITIAL:String			= "LoadCongmoneyAccountInitial";


		public static const LOAD_CONGMONEY_CORSNMONEY_COMPLETE:String		= "LoadCongmoneyCorsnmoneyComplete";
		public static const LOAD_CONGMONEY_CORSNMONEY_FAILED:String			= "LoadCongmoneyCorsnmoneyFailed";

		public static const LOAD_CONGMONEY_SAVEFAL_FAILED:String			= "LoadCongmoneySavefalFailed";

		public static const LOAD_TEMPLATE_COMPLETE:String					= "loadTemplateComplete";
		public static const LOAD_TEMPLATE_FAILED:String						= "loadTemplateFailed";

		public static const SELECTED_MEMBER:String							= "selectedMember";
		public static const MODIFIED_ACCOUNT:String							= "modifiedAccount";
		public static const SELECTED_FAMILY:String							= "selectedFamily";


		public function CelebrationFacade( key:String )
		{
			super(key);
		}

        /**
         * Singleton ApplicationFacade Factory Method
         */
        public static function getInstance( key:String ) : CelebrationFacade
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ] = new CelebrationFacade( key );
            return instanceMap[ key ] as CelebrationFacade;
        }

        /**
         * Register Commands with the Controller
         *     - parent 클래스의 생성자에서 자동으로 호출됨
         */
        override protected function initializeController( ) : void {
            super.initializeController();
            registerCommand( STARTUP, StartupCommand);
        }

        /**
         * Module의 시작점으로 Welfare.mxml의 creationComplete 이벤트에서 호출한다.
         *
         */
        public function startup(app:Object) :void
        {
        	trace("send startup in CongMoneyFacade");
        	this.app = app as DisplayObject;
            sendNotification( STARTUP, app );
        }

	}
}